<template>
  <Demo school="广州新华学院" @hello="f1"></Demo>
  <h2>{{ name }}</h2>
</template>

<script>
import Demo from "./components/Demo.vue";
import { ref } from "vue";
export default {
  name: "App",
  components: { Demo },
  setup() {
    //这样也能实现将子组件的数据传递给父组件
    let name=ref()
    function f1(value) {
      name.value=value
    }

    return {
      f1,
      name
    };
  },
};
</script>

<style>
</style>
